﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace TrabalhoSeven {
	class Imagem {

		protected Texture2D textura;
		protected Vector2 posicao;
		public bool visivel;
		protected float[] corRGB;
		public float[] CorRGB {
			set {
				corRGB = value;
			}
		}
		protected float alfa;
		protected Rectangle hitbox;
		public Rectangle Hitbox {
			get {
				return hitbox;
			}
		}

		public Imagem(Texture2D textura, Vector2 posicao, Rectangle hitbox) {
			this.textura = textura;
			this.posicao = posicao;
			this.visivel = true;
			this.corRGB = new float[3]; this.corRGB[0] = this.corRGB[1] = this.corRGB[2] = 1.0f;
			this.alfa = 1.0f;
			this.hitbox = hitbox;
		}

		public Imagem(Texture2D textura, Vector2 posicao) {
			this.textura = textura;
			this.posicao = posicao;
			this.visivel = true;
			this.corRGB = new float[3]; this.corRGB[0] = this.corRGB[1] = this.corRGB[2] = 1.0f;
			this.alfa = 1.0f;
			this.hitbox = new Rectangle();
		}

		public void Draw(SpriteBatch spriteBatch) {
			if (visivel == true) {
				spriteBatch.Draw(textura, posicao, 
					new Color(corRGB[0] * alfa, corRGB[1] * alfa, corRGB[2] * alfa, alfa)	
				);
			}
		}
	}
}
